package cz.data.common.support.security;

import cz.data.common.annotation.DataInner;
import org.springframework.http.HttpMethod;

public class AnnotationMatcherRule implements DynamicRequestMatcherRule {

    private final HttpMethod method;
    private final String[] mvcPattern;
    private final DataInner.Access access;

    public AnnotationMatcherRule(HttpMethod method, String[] mvcPattern, DataInner.Access access) {
        this.method = method;
        this.mvcPattern = mvcPattern;
        this.access = access;
    }

    @Override
    public HttpMethod method() {
        return method;
    }

    @Override
    public String[] patterns() {
        return mvcPattern;
    }

    @Override
    public String access() {
        return access.getValue();
    }
}
